package com.aaa.behind.controller;


import com.aaa.behind.service.IGSortService;
import com.aaa.entity.BrandMap;
import com.aaa.entity.GSort;
import com.aaa.util.PageInfo;
import com.aaa.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 商品类别 前端控制器
 * </p>
 *
 * @author whj
 * @since 2023-01-30
 */
@RestController
@RequestMapping("/g-sort")
public class GSortController {


    @Autowired
    private IGSortService igSortService;

    @PostMapping("findSortByCondition")
    public Result findSortByCondition(@ModelAttribute PageInfo pageInfo , BrandMap brandMap){
        return new Result(igSortService.findSortByCondition(pageInfo,brandMap));
    }

    @PostMapping("deleteSort")
    public Result deleteSort(Integer id){
        return new Result(igSortService.removeById(id));
    }

    @PostMapping("updateStatus")
    public Result updateStatus(GSort gSort){
        return new Result(igSortService.updateById(gSort));
    }

}

